/*
 * main.c
 *
 *  Created on: 29/gen/2014
 *      Author: Postazione Embedded
 */
#include "stm32f4xx.h"
#include "nrf24l01p/dl.h"

#define LENGTH		120
uint8_t tx_buffer[LENGTH];

void loopt() {
	TxPacket(tx_buffer, LENGTH, 0x02);
	//TxBroadcast_nRF24L01P(tx_buffer, 32);
	printf("Pacchetto trasmesso a 0x02!!\n");
	nRF24L01_Delay_us(500000);

}

int main() {
	int j = 0;
	setup_nRF24L01P();
	RxMode_nRF24L01P();
	for(; j < LENGTH; j++){
		tx_buffer[j+2] = j+1;
	}
	//tx_buffer[0] = (LENGTH & 0xff00) >> 8;
	//tx_buffer[1] = LENGTH & 0x00ff;

	printf("main\n");

	while (1) {
		loopt();
		//RxPacket(tx_buffer);
		toggleLeds(LED[1]);
	}
}

